{{- if .Values.global.database.gcloud.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "gcloud-sql-proxy.fullname" . }}
  labels:
    {{- include "gcloud-sql-proxy.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.global.database.port }}
      targetPort: cloud-sql-proxy
      protocol: TCP
      name: cloud-sql-proxy
  selector:
    {{- include "gcloud-sql-proxy.selectorLabels" . | nindent 4 }}
{{- end }}
